<template>
  <div style="width:100%;height:100%;" :id=bind_id></div>
</template>

<script>
  import echarts from 'echarts';

  export default {
    name: 'dataSourcePie',
    props:{
      bind_id: String,
      optionData: Object
    },
    data () {
      return {

      }
    },
    mounted () {
//      this.$nextTick(() => {
//        let dataSourcePie = echarts.init(document.getElementById(this.bind_id));
//        dataSourcePie.setOption(this.optionData);
//        window.addEventListener('resize', function () {
//          dataSourcePie.resize();
//        });
//      });
      let dataSourcePie = echarts.init(document.getElementById(this.bind_id));
      dataSourcePie.setOption(this.optionData);
      window.addEventListener('resize', function () {
        dataSourcePie.resize();
      });
    }
  };
</script>
<style>

</style>
